package me.zhengjie.business.rest;

import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.zhengjie.annotation.Log;
import me.zhengjie.business.domain.Hljg;
import me.zhengjie.business.domain.Jzdj;
import me.zhengjie.business.domain.sup.Gsgl;
import me.zhengjie.business.domain.vo.KC04;
import me.zhengjie.business.service.GsglService;
import me.zhengjie.business.service.Kc04Service;
import me.zhengjie.business.service.ZhsqService;
import me.zhengjie.business.service.ZhsqZyService;
import me.zhengjie.business.service.dto.ZhsqDto;
import me.zhengjie.business.service.dto.ZhsqQueryCriteria;
import me.zhengjie.config.DebugProperties;
import me.zhengjie.utils.SecurityUtils;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.List;

/**
 * @website 转院
 * @author xiahongbo
 * @date 2022-12-23
 **/
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(tags = "转院")
@RequestMapping("/api/zhsqZy")
public class ZhsqZyController {

    private final GsglService gsglService;
    private final ZhsqZyService zhsqZyService;

    @PutMapping(value = "/exeoto")
    @Log("机构转机构")
    @ApiOperation("机构转机构")
    public ResponseEntity<Object> exeoto(@RequestParam String idCard) {
        Long userid = SecurityUtils.getCurrentUserId();
        Gsgl gsgl = gsglService.queryGsgl(userid);
        zhsqZyService.exeOtO(idCard, gsgl.getBisGsglYljgdm());
        return new ResponseEntity<>(HttpStatus.NO_CONTENT);
    }

}
